(function(host, name){

var util = '$$$util$$$' in this ? this['$$$util$$$'] : require('./libra.util');
var Model = util.using('model.promise');

var ModelPromiseRequest = Model.Class('ModelPromiseRequest', function(){
}, {
	request: function(args){
		this.invoke(util.request, args);
	},
	reset: function(){
		this.put({ status: 0, text: null, error: null });
		return this;
	}
});

ModelPromiseRequest.create = function(fn){
	var schema = ['status', 'text', 'error'];
	var m = new ModelPromiseRequest(schema);
	if(util.isArray(schema) && util.isFunction(fn)){
		m.defineGetter(schema, fn);
	}
	return m;
};

util.regist(host, name, ModelPromiseRequest);


})(this, 'model.promise.request');
